package com.nya.roulette;

import java.util.HashMap;

import com.nya.roulette.JDKDActivity.TableSpace;

// Class Layout
// Relates the TableSpace to payout and location data.
public class Layout {

	private HashMap<TableSpace, LayoutData> tableSpaceLayoutData;
	
	private final class LayoutData {
		
		private int payout;
		private Point location;
		
		@SuppressWarnings("unused")
		private LayoutData() {}
		
		public LayoutData(int payout, Point location) {
			this.payout = payout;
			this.location = location;
		}
		
		public int getPayout() {
			return payout;
		}
		public Point getLocation() {
			return location;
		}
	}
	
	public Layout() {
		
		tableSpaceLayoutData = new HashMap<TableSpace, LayoutData>();
		
		tableSpaceLayoutData.put(TableSpace.ONE_TO_18, new LayoutData(1, new Point(100.0f, 265.0f)));
		tableSpaceLayoutData.put(TableSpace.EVEN, new LayoutData(1, new Point(190.0f, 265.0f)));
		tableSpaceLayoutData.put(TableSpace.BLACK, new LayoutData(1, new Point(280.0f, 265.0f)));
		tableSpaceLayoutData.put(TableSpace.RED, new LayoutData(1, new Point(370.0f, 265.0f)));
		tableSpaceLayoutData.put(TableSpace.ODD, new LayoutData(1, new Point(460.0f, 265.0f)));
		tableSpaceLayoutData.put(TableSpace.NINET_TO_36, new LayoutData(1, new Point(550.0f, 265.0f)));
		
		tableSpaceLayoutData.put(TableSpace.FIRST_12, new LayoutData(2, new Point(145.0f, 235.0f)));
		tableSpaceLayoutData.put(TableSpace.SECOND_12, new LayoutData(2, new Point(325.0f, 235.0f)));
		tableSpaceLayoutData.put(TableSpace.THIRD_12, new LayoutData(2, new Point(505.0f, 235.0f)));
		
		tableSpaceLayoutData.put(TableSpace.ROW_1, new LayoutData(2, new Point(619.0f, 185.0f)));
		tableSpaceLayoutData.put(TableSpace.ROW_2, new LayoutData(2, new Point(619.0f, 120.0f)));
		tableSpaceLayoutData.put(TableSpace.ROW_3, new LayoutData(2, new Point(619.0f, 55.0f)));
	}

	public int getPayout(TableSpace space) {
		return tableSpaceLayoutData.get(space).getPayout();
	}
	
	public Point getLocation(TableSpace space) {
		return tableSpaceLayoutData.get(space).getLocation();
	}
}